import {
    postForm
}
from '../../../utils/request'
Page({

  data: {
    basePath:getApp().globalData.basePath,
  },

  onLoad(options) {
    let id = options.id;
    if(!id){
      wx.switchTab({
        url: '/pages/goods/goods',
      })
      return;
    }
    this.setData({
      id:id
    })
    this.getSpu();
  },
  onReady() {  },
  onShow() {  },
  onHide() {  },
  onUnload() {  },
  onPullDownRefresh() {  },
  onReachBottom() {  },
  onShareAppMessage() {  },
  getSpu(){
    postForm({url:`front/api/goods/spu/${this.data.id}`}).then(resp=>{
      this.setData({
        target:resp
      })
    })
  },
})